package com.yydm.servicecms.controller;


import com.yydm.commonutils.R;
import com.yydm.servicecms.entity.CrmBanner;
import com.yydm.servicecms.service.ICrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author yydm
 * @since 2022-07-05
 */
@RestController
@RequestMapping("/servicecms/frontbanner")
//@CrossOrigin
public class FrontBannerController {

    @Autowired
    private ICrmBannerService crmBannerService;

    @Cacheable(value = "banner", key = "'getAllBanner'")
    @GetMapping("/getAllBanner")
    public R getAllBanner() {
        List<CrmBanner> list = crmBannerService.getAllBanner();
        return R.ok().data("list", list);
    }


}
